<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('代理商列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>代理商全称：</label>
                                <input type="text" name="agentName"/>
                            </li>
                            <li>
                                <label>代理商简称：</label>
                                <input type="text" name="agentShortname"/>
                            </li>
                            <li>
                                <label>代理商联系人：</label>
                                <input type="text" name="contactPerson"/>
                            </li>
                            <li>
                                <label>代理商联系人电话：</label>
                                <input type="text" name="contactMobile"/>
                            </li>
                            <li>
                                <label>代理商固定联系电话：</label>
                                <input type="text" name="agentTel"/>
                            </li>
                            <li>
                                <label>代理商邮箱：</label>
                                <input type="text" name="agentEmail"/>
                            </li>
                            <li>
                                <label>代理商级别(1-一级;2-二级;3-三级)：</label>
                                <input type="text" name="agentLevel"/>
                            </li>
                            <li>
                                <label>代理商所属地区编号(tb_system_area.area_id)：</label>
                                <input type="text" name="areaId"/>
                            </li>
                            <li>
                                <label>代理商营业地址：</label>
                                <input type="text" name="agentAddress"/>
                            </li>
                            <li>
                                <label>上级代理商编号：</label>
                                <input type="text" name="pid"/>
                            </li>
                            <li>
                                <label>法人姓名：</label>
                                <input type="text" name="legalName"/>
                            </li>
                            <li>
                                <label>法人身份证号码：</label>
                                <input type="text" name="legalIdcard"/>
                            </li>
                            <li>
                                <label>法人身份证正面照片：</label>
                                <input type="text" name="legalIdcardFront"/>
                            </li>
                            <li>
                                <label>法人身份证反面照片：</label>
                                <input type="text" name="legalIdcardReverse"/>
                            </li>
                            <li>
                                <label>结算银行(如:中国农业银行文三路支行)：</label>
                                <input type="text" name="legalSettleBank"/>
                            </li>
                            <li>
                                <label>结算账号：</label>
                                <input type="text" name="legalSettleAccount"/>
                            </li>
                            <li>
                                <label>修改人(tb_platform_operator.operator_id)：</label>
                                <input type="text" name="modifyBy"/>
                            </li>
                            <li>
                                <label>修改时间：</label>
                                <input type="text" class="time-input" placeholder="请选择修改时间" name="modifyTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:agent:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:agent:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:agent:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:agent:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:agent:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:agent:remove')}]];
        var prefix = ctx + "system/agent";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "代理商",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'agentId',
                    title: '代理商编号主键',
                    visible: false
                },
                {
                    field: 'agentName',
                    title: '代理商全称'
                },
                {
                    field: 'agentShortname',
                    title: '代理商简称'
                },
                {
                    field: 'contactPerson',
                    title: '代理商联系人'
                },
                {
                    field: 'contactMobile',
                    title: '代理商联系人电话'
                },
                {
                    field: 'agentTel',
                    title: '代理商固定联系电话'
                },
                {
                    field: 'agentEmail',
                    title: '代理商邮箱'
                },
                {
                    field: 'agentLevel',
                    title: '代理商级别(1-一级;2-二级;3-三级)'
                },
                {
                    field: 'areaId',
                    title: '代理商所属地区编号(tb_system_area.area_id)'
                },
                {
                    field: 'agentAddress',
                    title: '代理商营业地址'
                },
                {
                    field: 'pid',
                    title: '上级代理商编号'
                },
                {
                    field: 'agentType',
                    title: '代理商类型(1-企业;2-个人)'
                },
                {
                    field: 'legalName',
                    title: '法人姓名'
                },
                {
                    field: 'legalIdcard',
                    title: '法人身份证号码'
                },
                {
                    field: 'legalIdcardFront',
                    title: '法人身份证正面照片'
                },
                {
                    field: 'legalIdcardReverse',
                    title: '法人身份证反面照片'
                },
                {
                    field: 'legalSettleType',
                    title: '结算账户类型(1-对公;2-个人)'
                },
                {
                    field: 'legalSettleBank',
                    title: '结算银行(如:中国农业银行文三路支行)'
                },
                {
                    field: 'legalSettleAccount',
                    title: '结算账号'
                },
                {
                    field: 'status',
                    title: '代理商状态(0:正常; -1：禁用; -2:删除)'
                },
                {
                    field: 'remark',
                    title: '备注信息'
                },
                {
                    field: 'modifyBy',
                    title: '修改人(tb_platform_operator.operator_id)'
                },
                {
                    field: 'modifyTime',
                    title: '修改时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.agentId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.agentId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>